/*
 * @Author: jingfuu@163.com
 * @Date: 2024-06-30 08:02:22
 * @LastEditTime: 2024-12-04 09:44:38
 * @Description: file content
 */
import request from '@/utils/request'

// 查询公告列表
export function listNotice(query) {
  return request({
    url: '/system/notice/list',
    method: 'get',
    params: query
  })
}

export function listUserNotice(query) {
  return request({
    url: '/system/notice/user/list',
    method: 'get',
    params: query
  })
}

// 查询公告详细
export function getNotice(noticeId) {
  return request({
    url: '/system/notice/' + noticeId,
    method: 'get'
  })
}

// 新增公告
export function addNotice(data) {
  return request({
    url: '/system/notice',
    method: 'post',
    data: data
  })
}

// 修改公告
export function updateNotice(data) {
  return request({
    url: '/system/notice',
    method: 'put',
    data: data
  })
}

// 删除公告
export function delNotice(noticeId) {
  return request({
    url: '/system/notice/' + noticeId,
    method: 'delete'
  })
}

export function getNoticeAll() {
  return request({
    url: '/system/notice/all',
    method: 'get'
  })
}

export function readUserNoticeSingle(noticeId) {
  return request({
    url: '/system/notice/user/read/' + noticeId,
    method: 'put',
  })
}

export function readUserNoticeAll() {
  return request({
    url: '/system/notice/user/read-all',
    method: 'put',
  })
}